package com.genius.feign;

import com.genius.constant.SecurityConstants;
import com.genius.core.JSONResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestHeader;

@FeignClient("system-service")
public interface UserServiceFeign {

    /**
     * 根据用户账户查询用户信息
     * @param username 用户账户
     * @param fromSource 访问来源
     * @return 结果
     */
    @GetMapping("/user/selectUserByUserName/{username}")
    public JSONResult selectUserByUserName(@PathVariable("username") String username, @RequestHeader(SecurityConstants.FROM_SOURCE) String fromSource);

}
